<template>
  <div id="app" :style="{ backgroundImage: 'url(' + backgroundImageUrl + ')', backgroundSize: 'cover', backgroundPosition: 'center' }">
    <van-nav-bar
      title="🚀区块链游戏🚀"
      @click-left="onMenuClick"
      style="background: rgba(31, 150, 53, 0.6); color: white; font-size: 50px;"
    />

    <van-tabs v-model="activeTab" sticky swipeable>
      <van-tab  title="🎲随机事件" to="/">
        <router-link to="/" class="tab-content"></router-link>
      </van-tab>
      <van-tab title="🏦查询余额" to="/balance">
        <router-link to="/balance" class="tab-content"></router-link>
      </van-tab>
      <van-tab title="📜搜索交易" to="/search">
        <router-link to="/search" class="tab-content"></router-link>
      </van-tab>
    </van-tabs>

    <van-notice-bar left-icon="volume-o" text="🚀欢迎来到区块链大富翁！🌟一站式查询余额搜索交易🕹️ 玩转区块链游戏！"/>

    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      backgroundImageUrl: "https://gd-hbimg.huaban.com/418d270cf33ad2e295fda523d331c89337240a6a3eab1-9mSuKn", // 背景图链接
      activeTab: 0, // 当前选中标签页
    };
  },
  methods: {
    onMenuClick() {
      this.$toast("菜单功能待开发...");
    },
  },
};
</script>

<style>
@import url("../styles/global.css");

#app {
  --bg-color: #f4f6f9;
  background-color: var(--bg-color);
  min-height: 100vh;
  text-align: center;
  font-family: "Arial", sans-serif;
}

.tab-content {
  margin-top: 20px;
  padding: 20px;
}
</style>
